/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */


bool CheckVal(struct TreeNode* root,int val){
    if(!root)
        return true;
    if(!(root->val == val))
        return false;
    return CheckVal(root->left, val) && CheckVal(root->right, val);     
}
bool isUnivalTree(struct TreeNode* root){
    if(!root)
        return true;
     return CheckVal(root, root->val);
     }